Functions: eq 0 true s false inf cons take nil length
Constructors: 0 true s false cons nil
Variables: X Y L
Arities:
ar(eq) = 2
ar(0) = 0
ar(true) = 0
ar(s) = 1
ar(false) = 0
ar(inf) = 1
ar(cons) = 2
ar(take) = 2
ar(nil) = 0
ar(length) = 1
Replacement map:
µ(eq)={}
µ(0)={}
µ(true)={}
µ(s)={}
µ(false)={}
µ(inf)={1}
µ(cons)={}
µ(take)={1,2}
µ(nil)={}
µ(length)={1}
Rules: (file Ex1_GL02a)
eq(0,0) -> true
eq(s(X),s(Y)) -> eq(X,Y)
eq(X,Y) -> false
inf(X) -> cons(X,inf(s(X)))
take(0,X) -> nil
take(s(X),cons(Y,L)) -> cons(Y,take(X,L))
length(nil) -> 0
length(cons(X,L)) -> s(length(L))
obj Ex1_GL02a is sort S . op eq : S S -> S [strat (0)] . op 0 : -> S . op true : -> S . op s : S -> S [strat (0)] . op false : -> S . op inf : S -> S . op cons : S S -> S [strat (0)] . op take : S S -> S . op nil : -> S . op length : S -> S . vars X Y L : S . eq eq(0,0) = true . eq eq(s(X),s(Y)) = eq(X,Y) . eq eq(X,Y) = false . eq inf(X) = cons(X,inf(s(X))) . eq take(0,X) = nil . eq take(s(X),cons(Y,L)) = cons(Y,take(X,L)) . eq length(nil) = 0 . eq length(cons(X,L)) = s(length(L)) . endo
eq -> true
eq -> eq
eq -> false
inf(X) -> cons
take(0,X) -> nil
take(s,cons) -> cons
length(nil) -> 0
length(cons) -> s
is not terminating.
eq(0,0) -> true eq(s(X),s(Y)) -> eq(X,Y) eq(X,Y) -> falseis terminating (proved with MuTerm):
Proof of termination for CS-TRS Ex1a_GL02a: [eq](X1,X2) = X1 + X2 + 1 [0] = 0 [true] = 0 [s](X) = X + 1 [false] = 0hence µ-terminating.
inf(X) -> cons(X,inf(s(X))) take(0,X) -> nil take(s(X),cons(Y,L)) -> cons(Y,take(X,L)) length(nil) -> 0 length(cons(X,L)) -> s(length(L))is µ-terminating. This is proved by using Lucas' transformation: the TRS Ex1b_GL02a_L:
inf(X) -> cons take(0,X) -> nil take(s,cons) -> cons length(nil) -> 0 length(cons) -> sis terminating (proved with MuTerm):
Proof of termination for CS-TRS Ex1b_GL02a_L: [inf](X) = X + 1 [cons] = 0 [s] = 0 [take](X1,X2) = X1 + X2 + 1 [0] = 0 [nil] = 0 [length](X) = X + 1
See also the automatic modular proof computed by MuTerm
m(cons,2)= { inf,take } = W
m(s,1)= { length } = V
m(take',1)= { length } = V
m(length',1)= { inf,take } = W
eq > true,false inf> cons,inf',s take > nil,cons,take' cons> s length > 0,s,length'
st(take) = mul